package com.zsf.service.impl;

import com.zsf.bean.Emp;
import com.zsf.dao.EmpDao;
import com.zsf.service.Empservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @创建人 zsf
 * @创建时间 2022/12/26
 * @描述
 */
@Service
public class EmpServiceImpl implements Empservice {

    @Autowired
    private EmpDao empDaodao;

    @Override
    public List<Emp> queryAll() {
        return empDaodao.selectList(null);
    }

    @Override
    public Emp queryById(Integer empid) {
        return empDaodao.selectById(empid);
    }

    @Override
    public Boolean updateById(Emp emp) {
        return empDaodao.updateById(emp)>0;
    }

    @Override
    public Boolean deleteById(Integer id) {
        return empDaodao.deleteById(id)>0;
    }

    @Override
    public Boolean saveEmp(Emp emp) {
        return empDaodao.insert(emp) > 0;
    }
}
